/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import pojo.*;
import util.HibernateUtil;

/**
 *
 * @author DomKvic
 */
public class TypeSoftWareDAO {
    static public List<Typesoftware> getAll()
    {
        List<Typesoftware> list = null;
        Session session = HibernateUtil.getSessionFactory().openSession();
        session.beginTransaction();
        String hql = "FROM Typesoftware";
        Query query = session.createQuery(hql);
        list = query.list();
        session.close();
        return list;
    }
    
    public static Typesoftware getInfo(int idType) {
        Session session = util.HibernateUtil.getSessionFactory().openSession();
        session.beginTransaction();
        Typesoftware type= (Typesoftware) session.get(Typesoftware.class, idType);
        session.close();
        return  type; 
    }
}
